package listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener()
public class StartupListener implements ServletContextListener {
   
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext context = context = sce.getServletContext();
        
        String dbdriver = context.getInitParameter("dbdriver");
        String connstr = context.getInitParameter("connstr");
        
        context.setAttribute("dbdriver", dbdriver);
        context.setAttribute("connstr", connstr);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
    }
}
